from django.contrib import admin
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from movie import views
from account import views as account_views
from trade import views as trade_views

router = DefaultRouter()
router.register('movie', views.MovieViewSet)
router.register('category', views.CategoryViewSet)
router.register('collects', account_views.CollectViewSet, basename='collect')
router.register('card', trade_views.CardViewSet)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include(router.urls)),
    path('api/', include('djoser.urls')),
    path('api/', include('djoser.urls.jwt')),
    path('api/alipay/', trade_views.AlipayAPIView.as_view()),
    path('api/callback/', trade_views.AlipayCallbackAPIView.as_view()),
    path('api/tasks/', trade_views.TaskAPIView.as_view())
]
